package com.atguigu.springcloude.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Author yangjin
 * @Description
 * @Date 2021/6/26/15:02
 **/
@RestController
public class ConsumerZkController {
    public static final String  INVOKE_URL = "http://cloud-provider-payment";

    @Autowired
    RestTemplate restTemplate;

    @GetMapping(value = "/consumerzk/getzk")
    public String getPaymentInfo(){
        String invokeResult = restTemplate.getForObject(INVOKE_URL + "/payment/zk", String.class);
        return "消费者调用支付服务(zookeeper)--->result:"+invokeResult;
    }
}
